/*
 *  $Id: Bless.cs 1051 2010-05-18 22:10:41Z thenn.erannor $
 *	This file is a part of Ragima CCG.
 *	(C) 2008 Ragima development group.
 *
 *	Licensed under the terms of the GNU GPL License version 2.
 *
 */

namespace Ragima.Cards001.Light.Spells {
    public class Bless: SelfEnchantmentCard {
        public Bless(): base("001_l_s_bless") {
            Level = CompleteLevel.ReadyForTest;
            Element = ElementType.Light;
            Value = 100;
            AddManaCost(ElementType.Light, 2);
        }

        protected override EnchantmentAffect CreateEnchantment() {
            return new BlessAffect();
        }

        private class BlessAffect: EnchantmentAffect<Bless> {
            public BlessAffect() {
                Add(new TimeAffect(4, new BlessAura()));
            }
        }

        private class BlessAura: CreatureAuraAffect {
            public BlessAura(): base(true, false) {}

            public override string Id {
                get { return AffectManager.GetCardId<Bless>("aura"); }
            }

            protected override bool AcceptCreature(Creature cr) {
                return !cr.IsUndead;
            }

            protected override Affect CreateSubAffect() {
                return new BlessAuraAffect();
            }
        }

        private class BlessAuraAffect: SpellAffect<Bless> {
            public BlessAuraAffect() {
                Add(new Affects.ModDamage(1));
                Add(new Affects.ModMaxHealth(1));
            }
        }
    }
}
